<%--
  Created by IntelliJ IDEA.
  User: ZYT
  Date: 2022/5/22
  Time: 18:45
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>个人中心界面</title>
    <link rel="stylesheet" type="text/css" href="p_css/personal_center1.css">
    <script type="text/javascript" src="../static/js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#save").click(function () {
                alert("修改成功");
            })
            $(".submit1").click(function () {
                alert("修改成功!");
            })
        })
    </script>
</head>
<body>
<%--导航栏--%>
<nav>
    <a href="appointment.jsp" class="a1">&nbsp;&nbsp;挂号预约&nbsp;|&nbsp;&nbsp;</a>
    <a href="personal_center2.jsp" class="a2">&nbsp;&nbsp;&nbsp;个人中心&nbsp;|</a>
    <a href="login.jsp" class="a3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;退出登录</a>
    <div class="nav_right">
        <c:choose>
            <c:when test="${patient.p_sex=='女'}">
                <img class="nav_photo" alt="" src="images/1.jpg"/>
            </c:when>
            <c:otherwise>
                <img class="nav_photo" alt="" src="images/2.jpg"/>
            </c:otherwise>
        </c:choose>
<%--        <img src="images/2.jpg" class="nav_photo">--%>
        <span id="p_id" style="color: #ffffff">${sessionScope.patient.p_id}</span>
    </div>
</nav>

<%--左侧资料栏--%>
<div class="person_message">
    <div class="message1">
        <h4 class="message11">个人信息</h4>
        <c:choose>
            <c:when test="${patient.p_sex=='女'}">
                <img class="photo" alt="" src="images/1.jpg"/>
            </c:when>
            <c:otherwise>
                <img class="photo" alt="" src="images/2.jpg"/>
            </c:otherwise>
        </c:choose>
<%--        <img src="images/2.jpg" class="photo">--%>
        <ul class="list">
            <li>
                <button class="btn1">用户名称</button>
                <div class="div1">${sessionScope.patient.p_name}</div>
            </li>
            <li>
                <button class="btn1">手机号码</button>
                <div class="div2">${sessionScope.patient.p_id}</div>
            </li>
            <li>
                <button class="btn1">核酸结果</button>
                <div class="div4">阴性</div>
            </li>
            <li>
                <button class="btn1">过往病史</button>
                <div class="div5"></div>
            </li>
            <li>
                <button class="btn1"><a href="../checkAllOrder">预约情况</a></button>
                <div class="div6"></div>
            </li>
        </ul>
    </div>
</div>

<%--右侧个人资料栏--%>
<div class="right_message" id="right_message">
    <div class="message12"><button class="btn2" >基本资料</button> <button class="btn2" id="btn2">修改密码</button></div>
    <form action="/hospital/PersonalCenterServlet" method="post">
        <ul class="message_detail">
            <li>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <label class="red_star">用户名称</label>&nbsp;&nbsp;<input type="text" value="${sessionScope.patient.p_name}" name="p_name" class="m1">
            </li>
            <li>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <label class="red_star">手机号码</label>&nbsp;&nbsp;<input type="text" value="${sessionScope.patient.p_id}" name="p_id" class="m1">
            </li>
            <li>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <label class="red_star">身份证号码</label>&nbsp;&nbsp;<input type="text" value="${sessionScope.patient.id_card}" name="id_card" class="m1">
            </li>
            <li>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <label>年龄</label>&nbsp;&nbsp;
                <input type="text" name="p_age" value="${sessionScope.patient.p_age}" class="m1">
            </li>
            <li>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <label>性别</label>&nbsp;&nbsp;
                <input id="man" type="radio" name="p_sex" value="男" ${sessionScope.patient.p_sex == "男"?'checked':''}>男&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" id="woman" name="p_sex" value="女" ${sessionScope.patient.p_sex == "女"?'checked':''}>女
            </li>
            <li>
                <input type="submit" value="保存" name="submit" id="save">
            </li>
        </ul>
    </form>
</div>
<div class="change_password" id="change_password">
    <h4 class="message12"><button class="btn2" id="btn1">基本资料</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button class="btn2" >修改密码</button></h4>
    <form action="/hospital/PasswordChangeServlet" method="post">
        <ul class="change_password1">
            <li>
                <label>&nbsp;&nbsp;&nbsp;请输入原密码：</label>
                <input type="password" name="p_password" class="m1">
            </li>
            <li>
                <label>&nbsp;&nbsp;&nbsp;请输入新密码：</label>
                <input type="password" name="p_password1" class="m1">
            </li>
            <li>
                <label>&nbsp;&nbsp;&nbsp;请确认新密码：</label>
                <input type="password" name="p_password2" class="m1">
            </li>
            <li>
                <input type="submit" value="确定" name="submit" class="submit1">
            </li>
        </ul>
    </form>
</div>
<script type="text/javascript">
        var password1=document.getElementById("change_password");
        var messages1=document.getElementById("btn2");
        var messages2=document.getElementById("btn1");
        messages1.onclick=function () {
            password1.style.display = "block";
        }
        messages2.onclick=function () {
                password1.style.display="none";
        }
</script>
</body>
</html>
